package cn.iocoder.yudao.module.infra.tts.impl.bytedance;

import lombok.Data;

import java.util.Base64;

@Data
public class ByteDanceTtsResponse {
    private String reqid;
    private int code;
    private String operation;
    private String message;
    private int sequence;
    private String data; // Base64 encoded binary data
    private Addition addition;

    // Method to decode the base64 data
    public byte[] getDecodedData() {
        return Base64.getDecoder().decode(data);
    }

    // Inner class for the addition field
    @Data
    public static class Addition {
        private String duration;
    }

    public boolean isSuccess() {
        return code == 3000;
    }

}